package com.hmi.simulatedrive.lifecycle

import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import com.amap.api.navi.AMapNaviView

class AMapViewLifecyleObserve: DefaultLifecycleObserver {
    var aMapView: AMapNaviView? = null

    constructor(aMapView: AMapNaviView?) {
        this.aMapView = aMapView
    }


    override fun onCreate(owner: LifecycleOwner) {
        super.onCreate(owner)
    }

    override fun onDestroy(owner: LifecycleOwner) {
        super.onDestroy(owner)
        aMapView!!.onDestroy()
    }

    override fun onPause(owner: LifecycleOwner) {
        super.onPause(owner)
        aMapView!!.onPause()
    }

    override fun onResume(owner: LifecycleOwner) {
        super.onResume(owner)
        aMapView!!.onResume()
    }

}